/*
 * @Author: qin
 * @Date:   2018-08-28
 * +----------------------------------------------------------------------
 * | admin [ 后台管理系统公共配置信息 ]
 * |
 * +----------------------------------------------------------------------
 */
layui.define(['configure', 'configureCom'], function (exports) {
    var configure = layui.configure;
    var configureCom = layui.configureCom;
    var workDeal = {
        param: {},
        getLeaderList: function () { // 获取技术负责人列表
            return new Promise(function (resolve, reject) {
                configureCom.getAjax(configure.REVIEW_WORKDEAL_LEADER_LIST_HTTP).then(function (res) {
                    resolve(res);
                }, function (err) {
                    reject(err);
                });
            });
        },
        getExpertList: function () { // 获取专家列表
            return new Promise(function (resolve, reject) {
                configureCom.getAjax(configure.REVIEW_WORKDEAL_EXPERT_LIST_HTTP).then(function (res) {
                    resolve(res);
                }, function (err) {
                    reject(err);
                });
            });
        },
        getSpeciatyList: function (data) { // 获取当前单位工程上传图纸对应专业列表
            return new Promise(function (resolve, reject) {
                configureCom.getAjax(configure.REVIEW_WORKDEAL_SPECIATY_LIST_HTTP, data).then(function (res) {
                    resolve(res);
                }, function (err) {
                    reject(err);
                });
            });
        },
        assiginExpert: function (data) {//确认分配
            return new Promise(function (resolve, reject) {
                configureCom.postAjax(configure.REVIEW_WORKDEAL_ASSIGN_EXPERT_HTTP, JSON.stringify(data)).then(function (res) {
                    resolve(res);
                }, function (err) {
                    reject(err);
                });
            });
        },
        cancelAssign: function (data) { //取消分配
            return new Promise(function (resolve, reject) {
                configureCom.putDataAjax(configure.REVIEW_WORKDEAL_CANCEL_ASSIGN_HTTP, data).then(function (res) {
                    resolve(res);
                }, function (err) {
                    reject(err);
                });
            });
        },
        getAssignList: function (data) { //查看分配列表
            return new Promise(function (resolve, reject) {
                configureCom.getAjax(configure.REVIEW_WORKDEAL_ASSIGN_READONLY_HTTP, data).then(function (res) {
                    resolve(res);
                }, function (err) {
                    reject(err);
                });
            });
        }
    };
    exports('workDeal', workDeal);
});